Page({
    data: {
        foodname: "今天打什么车呢？",
        fooditems: [ "呀,今天走路回去吧", "高德打车", "滴滴打车", "花小猪打车", "喝酒了，找个代驾" ],
        animate: !1,
        isclick: !1,
        dateMonth: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ][new Date().getMonth()],
        dateDay: new Date().getDate(),
        dateWeek: [ "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" ][new Date().getDay()]
    },
    onLoad: function(e) {},
    onReady: function() {
        this.getTimeFood();
    },
    getTimeFood: function() {
        var e = this, t = new Date().getHours() + ":" + new Date().getMinutes();
        console.log(t), wx.request({
            url: "https://res.guqule.com/time.json?v=" + new Date().getMinutes(),
            method: "get",
            data: {},
            success: function(a) {
                console.log(a.data), a.data.map(function(a, o) {
                    (e.equalDate(t, a.start_time) || e.compareDate(a.start_time, t)) && e.compareDate(t, a.end_time) && e.setData({
                        foodname: a.text,
                        fooditems: a.menus
                    });
                }), "今天吃什么呢？" == e.foodname && (e.foodname = a.data[4].text, e.fooditems = a.data[4].menus);
            }
        });
    },
    compareDate: function(e, t) {
        var a = new Date(), o = e.split(":"), n = t.split(":");
        return a.setHours(o[0], o[1]) < a.setHours(n[0], n[1]);
    },
    equalDate: function(e, t) {
        var a = new Date(), o = e.split(":"), n = t.split(":");
        return a.setHours(o[0], o[1]) == a.setHours(n[0], n[1]);
    },
    rolledUp: function() {
        console.log(this.data.animate), this.data.animate || (this.setData({
            isclick: !0,
            animate: !0
        }), this.bbb(100, 10, 0));
    },
    bbb: function(e, t, a) {
        var o = this;
        o.setData({
            foodname: o.data.fooditems[Math.floor(Math.random() * o.data.fooditems.length)]
        }), o.timer = setInterval(function() {
            o.setData({
                foodname: o.data.fooditems[Math.floor(Math.random() * o.data.fooditems.length)]
            }), clearInterval(o.timer), o.timer = null, t > a ? o.bbb(e, t, a + 1) : o.setData({
                animate: !1
            });
        }, e);
    },
    gotoeleOtherApp1: function() {
        wx.navigateToMiniProgram({
            appId: "wxaf35009675aa0b2a",
            path: "/pages/index/index?scene=QDXeloE&source_id=790-1"
        });
    },
    gotoPinOtherApp2: function() {
        wx.navigateToMiniProgram({
            appId: "wxaf35009675aa0b2a",
            path: "/pages/index/index?scene=QDXeloE&source_id=790-1"
        });
    },
    gotoMeiOtherApp3: function() {
        wx.navigateToMiniProgram({
            appId: "wxd98a20e429ce834b",
            path: "/pages/chitu/index?scene=dKPKPqj&source_id=790-1"
        });
    },
    gotoMeiOtherApp4: function() {
        wx.navigateToMiniProgram({
            appId: "wxd98a20e429ce834b",
            path: "/pages/chitu/index?scene=dKPKPqj&source_id=790-1"
        });
    },
    gotoMeiOtherApp5: function() {
        wx.navigateToMiniProgram({
            appId: "wxaf35009675aa0b2a",
            path: "/pages/index/index?scene=QDXeloE&source_id=790-1"
        });
    },
    gotoMeiOtherApp6: function() {
        wx.navigateToMiniProgram({
            appId: "wxaf35009675aa0b2a",
            path: "/pages/index/index?scene=QDXeloE&source_id=790-1"
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});